require "extend/BaseTablePool"

local P = NewClass(BaseTablePool, ClassFromFile(...))
Vector2Ex.SetPool(P)

function P:New()
	return Vector2Ex._New()
end

function P:Recycle(v)
	if v ~= nil and v.w ~= nil then
		logError("test_recycle: "..debug.traceback())
	end

	P.super.Recycle(self, v)
end

-- function P:SubMagnitude(b, c)
-- 	local a = self:Sub(b, c)
-- 	local magnitude = a:Magnitude()
-- 	self:Recycle(a)
-- 	return magnitude
-- end

-- function P:SubMagnitudeWithoutY(b, c)
-- 	local a = self:Sub(b, c)
-- 	a.y = 0
-- 	local magnitude = a:Magnitude()
-- 	self:Recycle(a)
-- 	return magnitude
-- end


-- function P:Zero()
-- 	local a = self:Create()
-- 	a.x = 0
-- 	a.y = 0
-- 	return a
-- end

P.zero = Vector2Ex.zero
